package com.tm.test;

import com.tm.util.DBUtil;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class deleteStudent {

    private static Connection conn = null;
    private static Statement stmt = null;

    public static void main(String[] args) {

        conn = DBUtil.getConn();

        try {
            stmt = conn.createStatement();
            if (stmt.executeUpdate("delete from stu where stu_id=12") > 0) {
                System.out.println("删除成功");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
